﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Acme.BookStore2.Migrations
{
    public partial class vehiclerepairerecord : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_VehicleRepairRecord_AppVehicle_VehicleId1",
                table: "VehicleRepairRecord");

            migrationBuilder.DropPrimaryKey(
                name: "PK_VehicleRepairRecord",
                table: "VehicleRepairRecord");

            migrationBuilder.RenameTable(
                name: "VehicleRepairRecord",
                newName: "AppVehicleRepairRecord");

            migrationBuilder.RenameIndex(
                name: "IX_VehicleRepairRecord_VehicleId1",
                table: "AppVehicleRepairRecord",
                newName: "IX_AppVehicleRepairRecord_VehicleId1");

            migrationBuilder.AddPrimaryKey(
                name: "PK_AppVehicleRepairRecord",
                table: "AppVehicleRepairRecord",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_AppVehicleRepairRecord_AppVehicle_VehicleId1",
                table: "AppVehicleRepairRecord",
                column: "VehicleId1",
                principalTable: "AppVehicle",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_AppVehicleRepairRecord_AppVehicle_VehicleId1",
                table: "AppVehicleRepairRecord");

            migrationBuilder.DropPrimaryKey(
                name: "PK_AppVehicleRepairRecord",
                table: "AppVehicleRepairRecord");

            migrationBuilder.RenameTable(
                name: "AppVehicleRepairRecord",
                newName: "VehicleRepairRecord");

            migrationBuilder.RenameIndex(
                name: "IX_AppVehicleRepairRecord_VehicleId1",
                table: "VehicleRepairRecord",
                newName: "IX_VehicleRepairRecord_VehicleId1");

            migrationBuilder.AddPrimaryKey(
                name: "PK_VehicleRepairRecord",
                table: "VehicleRepairRecord",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_VehicleRepairRecord_AppVehicle_VehicleId1",
                table: "VehicleRepairRecord",
                column: "VehicleId1",
                principalTable: "AppVehicle",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }
    }
}
